package gbench.sandbox.matrix;

import static gbench.common.tree.LittleTree.IRecord.A;
import static gbench.common.tree.LittleTree.IRecord.REC;
import org.junit.jupiter.api.Test;
import gbench.commonApp.data.DataMatrixApp;

public class JunitDataMatrixCell extends DataMatrixApp{
    
   
    @Test
    public void bar() {
        final var wts = A(10.2d,8d,9d);
        final var bias = 10d;
        final var _wts = REC("wts",A(bias,wts));
        println(_wts.toString2());
        final var _wts_mx = REC2DMX(Double.class,_wts);
        _wts_mx.set(2, 0, 100d);
        final var reference = _wts_mx.referrence(1,1);// 提取单元格的引用。
        reference.setValue(-10d);
        reference.offset(1, 0).setValue(20d);
        println(_wts_mx);
        try {
            //  这里会出现越界的错误
            _wts_mx.referrence(100,100).setValue(-10d);
        }catch(Exception e) {
            e.printStackTrace();
        }
    }
    

}
